import { Column, Entity, ManyToMany, PrimaryGeneratedColumn } from 'typeorm'

import { SysUserEntity } from '.'
import { BaseEntity } from './base.entity'

@Entity()
export class SysPostEntity extends BaseEntity implements ISysPostEntity {
  @PrimaryGeneratedColumn({ type: 'bigint' })
  postId: string

  @Column()
  postCode: string

  @Column()
  postName: string

  @Column()
  postSort: number

  @Column()
  status: string

  @Column()
  remark: string

  @ManyToMany(type => SysUserEntity, user => user.posts)
  users: SysUserEntity[]
}
